package swingFiles;

import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.Color;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.SwingConstants;
import javax.swing.JButton;

/**
 * Creates the panel for the instructors of the gym management system.
 * 
 * @author Emily Linniman
 * @version December 1, 2014
 *
 */
@SuppressWarnings("serial")
public class InstructorHome extends JPanel {

	/** The frame on which the panel is placed. */
	private JFrame my_frame;

	/**
	 * Create the frame.
	 */
	public InstructorHome(JFrame the_frame) {
		setBackground(Color.ORANGE);
		my_frame = the_frame;
		my_frame.setBackground(Color.ORANGE);
		my_frame.setTitle("Instructor");
		my_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		setBounds(100, 100, 450, 300);
		setLayout(null);
		
		JLabel welcomeLabel = new JLabel("Welcome, Instructor!");
		welcomeLabel.setBounds(140, 6, 165, 22);
		welcomeLabel.setHorizontalAlignment(SwingConstants.CENTER);
		welcomeLabel.setFont(new Font("Arial", Font.PLAIN, 18));
		add(welcomeLabel);
		
		JLabel yourClassesLabel = new JLabel("     Your Classes:     ");
		yourClassesLabel.setBounds(6, 39, 125, 16);
		yourClassesLabel.setHorizontalAlignment(SwingConstants.CENTER);
		add(yourClassesLabel);
		
		JLabel classesLabel = new JLabel("");
		classesLabel.setBounds(159, 255, -130, -189);
		add(classesLabel);

		JButton makeClassButton = new JButton("Create a Class");
		makeClassButton.setBounds(245, 73, 155, 29);
		makeClassButton.setFont(new Font("Arial", Font.PLAIN, 15));
		add(makeClassButton);
		
		JButton myReviewsButton = new JButton("See My Reviews");
		myReviewsButton.setFont(new Font("Arial", Font.PLAIN, 15));
		myReviewsButton.setBounds(245, 155, 155, 29);
		add(myReviewsButton);
		
		JButton cancelClassButton = new JButton("Cancel a Class");
		cancelClassButton.setFont(new Font("Arial", Font.PLAIN, 15));
		cancelClassButton.setBounds(245, 114, 155, 29);
		add(cancelClassButton);
		
		JButton logoutButton = new JButton("Logout");
		logoutButton.setBounds(245, 200, 155, 29);
		logoutButton.setFont(new Font("Arial", Font.PLAIN, 15));
		logoutButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				my_frame.setContentPane(new LogIn(my_frame));
				my_frame.validate();
				my_frame.setVisible(true);
			}
		});
		add(logoutButton);
	}

}
